package com.mulInterface;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:周次煜
 * Date: 2024-03-05
 * Time：20:17
 */
abstract public class Animal {
    public String name;

    public Animal(String name) {
        this.name = name;
    }

    abstract public void Sleep();
}

class Fash extends Animal implements Swim {


    public Fash(String name) {
        super(name);
    }

    @Override
    public void Sleep() {
        System.out.println(super.name+"正在睡觉！");
    }

    @Override
    public void swim() {
        System.out.println(super.name+"正在游泳！");
    }
}

class Dusk extends Animal implements Fly,Swim,Run {

    public Dusk(String name) {
        super(name);
    }

    @Override
    public void Sleep() {
        System.out.println(super.name+"正在睡觉！");
    }

    @Override
    public void fly() {
        System.out.println(super.name+"正在飞翔！");
    }

    @Override
    public void run() {
        System.out.println(super.name+"正在奔跑！");
    }

    @Override
    public void swim() {
        System.out.println(super.name+"正在游泳！");
    }
}



class Bird extends Animal implements Fly{

    public Bird(String name) {
        super(name);
    }

    @Override
    public void Sleep() {
        System.out.println(super.name+"正在睡觉！");

    }

    @Override
    public void fly() {
        System.out.println(super.name+"正在飞翔！");
    }
}
